// 开始和结束增加一些 逻辑

const perform = (fn, wrappers) => {
  wrappers.forEach(item => {
    item.initilizae()
  })
  fn()
  wrappers.forEach(item => {
    item.close()
  })
}

perform(()=>{
  console.log('说话')
}, [
  {
    initilizae() {
      console.log('nihao')
    },
    close() {
      console.log('再见')
    }
  },
  {
    initilizae() {
      console.log('nihao2')
    },
    close() {
      console.log('再见2')
    }
  }
])